/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vera.hibernate.dao;

import org.hibernate.Session;
import vera.hibernate.util.HibernateUtil;

/**
 *
 * @author vgncr35g
 */
public class EntityDAO {
    
    public EntityDAO()
    {
        
    }
    public void addEntity(Object entity)
    {
        Session s = HibernateUtil.openSession();
        s.save(entity);
        s.flush();
        s.close();
    }
    
    public void updateEntity(Object entity)
    {
        Session s = HibernateUtil.openSession();
        s.update(entity);
        s.flush();
        s.close();
    }
    
    public void deleteEntity(Object entity)
    {
        Session s = HibernateUtil.openSession();
        s.delete(entity);
        s.flush();
        s.close();
    }
}
